import QtQuick
import QtQuick.Controls


Item {
    // 容器尺寸：宽1920，高980
    id: materialListWindow
    width: 1910
    height: 995

    Rectangle{
        anchors.fill: parent
        radius: 5
        // border.width: 1
        // border.color: "black"
        color: "#f0f0f0"
    }

    Component.onCompleted: {
        currentPage = 8
        materialpageLoader.source = "MaterialParameterWindow.qml"
    }


    Row{
        anchors.top: parent.top
        anchors.topMargin: 10
        anchors.left: parent.left
        anchors.leftMargin: 5
        spacing: 5

        // A_Button{
        //     contentText_Data: qsTr("读取信息")
        // }
        A_Button{
            contentText_Data: qsTr("型材参数")
            isSelected: currentPage === 8 || currentPage === 3
            onButtonClicked: {
                currentPage = 8
                materialpageLoader.source = "MaterialParameterWindow.qml"
            }
        }
        // A_Button{
        //     contentText_Data: qsTr("接口参数")
        //     isSelected: currentPage === 9
        //     onButtonClicked: {
        //         currentPage = 9
        //         materialpageLoader.source = "MaterialList_PortParameter_Window.qml"
        //     }
        // }
        // A_Button{
        //     buttonWidth: 300
        //     contentText_Data: qsTr("删除全部工程单据")
        // }

    }



    Loader{
        id: materialpageLoader
        anchors.top: materialListWindow.top
        anchors.topMargin: 70
        anchors.horizontalCenter: materialListWindow.horizontalCenter

        onStatusChanged: {
            switch(status) {
            case Loader.Null :{
                console.debug("加载空项");
                break;
            }
            case Loader.Ready:{
                console.info("加载完成: " + source);
                break;
            }
            case Loader.Loading :{
                console.debug("加载中: "+source);
                break;
            }
            case Loader.Error :{
                console.error("加载错误: "+ source);
                break;
            }
            }
        }

    }
}
